package pri.zxx.testdemo;

public class NumTest {

    public static boolean exit(int index, int[] indexs) {
        for (int i = 0; i < indexs.length - 1; i++) {
            if (index == indexs[i]) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int[] nums = {0, 0, 1, 1, 1, 2, 2, 3, 3, 4};
        int length = nums.length;
        int[] index = new int[length];
        int indexCount = 0;
        for (int i = 0; i < length; i++) {
            for (int j = i + 1; j < length; j++) {
                if (nums[i] == nums[j]) {
                    index[indexCount] = j;
                    indexCount++;
                }
            }
        }
        int[] indexnow = new int[indexCount];

        if (indexnow.length >= 0) System.arraycopy(index, 0, indexnow, 0, indexnow.length);

        int inset = 0;
        for (int i = 0; i < length - 1; i++) {
            if (!NumTest.exit(i, indexnow)) {
                nums[inset] = nums[i];
                inset++;
            }
        }
        for (int i = 0; i < length - 1; i++) {
            System.out.println(nums[i]);
        }
    }
}